/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package sv.gob.presidencia.cultura.espacios.entidades;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author edgardo
 */
@Entity
@Table(name = "contacto")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Contacto.findAll", query = "SELECT c FROM Contacto c"),
    @NamedQuery(name = "Contacto.findByIdContacto", query = "SELECT c FROM Contacto c WHERE c.idContacto = :idContacto"),
    @NamedQuery(name = "Contacto.findByNombreContacto", query = "SELECT c FROM Contacto c WHERE c.nombreContacto = :nombreContacto"),
    @NamedQuery(name = "Contacto.findByTelefonoContacto", query = "SELECT c FROM Contacto c WHERE c.telefonoContacto = :telefonoContacto"),
    @NamedQuery(name = "Contacto.findByCorreoContacto", query = "SELECT c FROM Contacto c WHERE c.correoContacto = :correoContacto"),
    @NamedQuery(name = "Contacto.findByWebContacto", query = "SELECT c FROM Contacto c WHERE c.webContacto = :webContacto"),
    @NamedQuery(name = "Contacto.findByFacebookContacto", query = "SELECT c FROM Contacto c WHERE c.facebookContacto = :facebookContacto"),
    @NamedQuery(name = "Contacto.findByTwitterContacto", query = "SELECT c FROM Contacto c WHERE c.twitterContacto = :twitterContacto")})
public class Contacto implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id_contacto")
    private Integer idContacto;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 100)
    @Column(name = "nombre_contacto")
    private String nombreContacto;
    @Size(max = 9)
    @Column(name = "telefono_contacto")
    private String telefonoContacto;
    @Size(max = 50)
    @Column(name = "correo_contacto")
    private String correoContacto;
    @Size(max = 30)
    @Column(name = "web_contacto")
    private String webContacto;
    @Size(max = 30)
    @Column(name = "facebook_contacto")
    private String facebookContacto;
    @Size(max = 30)
    @Column(name = "twitter_contacto")
    private String twitterContacto;
    @JoinColumn(name = "id_espacio_cultural", referencedColumnName = "id_espacio_cultural")
    @ManyToOne(optional = false)
    private EspacioCultural idEspacioCultural;

    public Contacto() {
    }

    public Contacto(Integer idContacto) {
        this.idContacto = idContacto;
    }

    public Contacto(Integer idContacto, String nombreContacto) {
        this.idContacto = idContacto;
        this.nombreContacto = nombreContacto;
    }

    public Integer getIdContacto() {
        return idContacto;
    }

    public void setIdContacto(Integer idContacto) {
        this.idContacto = idContacto;
    }

    public String getNombreContacto() {
        return nombreContacto;
    }

    public void setNombreContacto(String nombreContacto) {
        this.nombreContacto = nombreContacto;
    }

    public String getTelefonoContacto() {
        return telefonoContacto;
    }

    public void setTelefonoContacto(String telefonoContacto) {
        this.telefonoContacto = telefonoContacto;
    }

    public String getCorreoContacto() {
        return correoContacto;
    }

    public void setCorreoContacto(String correoContacto) {
        this.correoContacto = correoContacto;
    }

    public String getWebContacto() {
        return webContacto;
    }

    public void setWebContacto(String webContacto) {
        this.webContacto = webContacto;
    }

    public String getFacebookContacto() {
        return facebookContacto;
    }

    public void setFacebookContacto(String facebookContacto) {
        this.facebookContacto = facebookContacto;
    }

    public String getTwitterContacto() {
        return twitterContacto;
    }

    public void setTwitterContacto(String twitterContacto) {
        this.twitterContacto = twitterContacto;
    }

    public EspacioCultural getIdEspacioCultural() {
        return idEspacioCultural;
    }

    public void setIdEspacioCultural(EspacioCultural idEspacioCultural) {
        this.idEspacioCultural = idEspacioCultural;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idContacto != null ? idContacto.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Contacto)) {
            return false;
        }
        Contacto other = (Contacto) object;
        if ((this.idContacto == null && other.idContacto != null) || (this.idContacto != null && !this.idContacto.equals(other.idContacto))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "sv.gob.presidencia.cultura.espacios.entidades.Contacto[ idContacto=" + idContacto + " ]";
    }
    
}
